{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "64c5361c-159b-4905-80c6-de1577a8254b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "第 8 天桃子数为： 1\n",
      "第 7 天桃子数为： 4\n",
      "第 6 天桃子数为： 10\n",
      "第 5 天桃子数为： 22\n",
      "第 4 天桃子数为： 46\n",
      "第 3 天桃子数为： 94\n",
      "第 2 天桃子数为： 190\n",
      "第 1 天桃子数为： 382\n"
     ]
    }
   ],
   "source": [
    "p = 1 #第8天桃子数为1\n",
    "for i in range(8, 0,-1):\n",
    "    print(\"第\",i,\"天桃子数为：\",p)\n",
    "    p = 2 * (p + 1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ae3b4865-110a-4f6d-806a-38549ea86c00",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
